import React, {useState,createContext,useContext } from 'react';
const countContext=createContext();
function Countre(){
    let count=useContext(countContext)
    return (<h2>{count}</h2>)
}
function Example5(){
    const[count,setCount]=useState(0)
    return(
        <div>
            <p>You click {count} times</p>
            <button onClick={()=>{setCount(count+1)}}>Click me</button>
            <countContext.Provider value={count}>
                <Countre/>
            </countContext.Provider>
        </div>
    )
}

export default Example5;